#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    getline(cin, s);
    int n = s.size();
    s[n] = ' ';

    int wordNum = 0; // 单词数
    string wordContent;
    string words[n];
    for (int i = 0; i <= n; i++)
    {
        if (s[i] == ' ')
        {
            wordNum++;
            words[wordNum] = wordContent; // 记录每个单词完整字符内容
            wordContent = "";
        } else {
            wordContent += s[i];

        }
    }

    for(int i = 1; i <= wordNum; i++) {
        if(words[i] == " ") {
            continue;
        }
        for (int j = words[i].size() - 1; j >= 0; j--)
        {
            cout << words[i][j];
        }
        cout << " ";
    }
    
    return 0;
}